import request from '@/utils/request'
import { multiUpload } from '@/utils/upload'

// ==================== 陪爬员端接口 ====================

/**
 * 开始服务
 * @param {Object} data - {orderId, photo, description}
 */
export function startService(data) {
  return multiUpload('/api/service/start', data)
}

/**
 * 上传服务照片
 * @param {Object} data - {orderId, photos[], description}
 */
export function uploadPhotos(data) {
  return multiUpload('/api/service/upload', data)
}

/**
 * 结束服务
 * @param {Object} data - {orderId, photo, description}
 */
export function endService(data) {
  return multiUpload('/api/service/end', data)
}

// ==================== 用户端接口 ====================

/**
 * 获取订单进度
 * @param {Number} orderId - 订单ID
 */
export function getOrderProgress(orderId) {
  return request({
    url: `/api/order/${orderId}/progress`,
    method: 'get'
  })
}

/**
 * 获取服务记录列表
 * @param {Number} orderId - 订单ID
 */
export function getServiceRecords(orderId) {
  return request({
    url: `/api/order/${orderId}/records`,
    method: 'get'
  })
}

// ==================== 管理端接口 ====================

/**
 * 获取所有服务记录
 */
export function getAllServiceRecords() {
  return request({
    url: '/api/service/records/all',
    method: 'get'
  })
}

